-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
benchmark workflow -> base R #1249
Conversation
Benchmark results 💥 means that PR is more than 5% slower than main or CRAN Click to see benchmark results
Generated via commit 26d114d Download link for the artifact containing the test results: ↓ benchmark-results.zip |
@etiennebacher I just re-wrote the benchmark script in mostly base R. No action need. Just a FYI. |
Thanks, I had tried with data.table but unnesting was surprisingly unfriendly compared to tidyverse. |
Yeah, I think the pattern in library(data.table)
url <- "https://vincentarelbundock.github.io/Rdatasets/csv/HistData/Guerry.csv"
dat <- na.omit(fread(url))
nested = dat[, list(data=list(.SD)), by=Region]
unnested = nested[, data[[1]], by = Region]
head(nested, 2)
> Region data
> <char> <list>
> 1: E <data.table[17x23]>
> 2: N <data.table[17x23]>
head(unnested, 2)
> Region rownames dept Department Crime_pers Crime_prop Literacy Donations
> <char> <int> <int> <char> <int> <int> <int> <int>
> 1: E 1 1 Ain 28870 15890 37 5098
> 2: E 4 4 Basses-Alpes 12935 7289 46 2733
> Infants Suicides MainCity Wealth Commerce Clergy Crime_parents Infanticide
> <int> <int> <char> <int> <int> <int> <int> <int>
> 1: 33120 35039 2:Med 73 58 11 71 60
> 2: 23018 14238 1:Sm 76 49 5 70 12
> Donation_clergy Lottery Desertion Instruction Prostitutes Distance Area
> <int> <int> <int> <int> <int> <num> <int>
> 1: 69 41 55 46 13 218.372 5762
> 2: 37 80 32 29 2 351.399 6925
> Pop1831
> <num>
> 1: 346.03
> 2: 155.90 |
No description provided.